<%@ page language="java" contentType="text/html; charset=UTF-8"
	pageEncoding="UTF-8"%>
<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">
<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
<script type="text/javascript" src="/assets/js/jquery.min.js"></script>
<title>注册</title>
</head>
<body>
	<form>
		<div>
			<td>请输入名称:</td>
			<td><input class="txt" type="text" id="userName" value="">
		</div>
		<div>
			<td>请输入密码:</td>
			<td><input class="txt" type="text" id="poss1" value="">
		</div>
		<div>
			<td>请再次输入密码:</td>
			<td><input class="txt" type="text" id="poss2" value="">
		</div>
		<div>
			<input type="button" value="提交" onclick="register()">
			<a href="/test/land"><input type="button" value="返回"></input></a>
		</div>
	</form>
	<script type="text/javascript">
		function register() {
			var userName = $('#userName').val();
			var poss1 = $('#poss1').val();
			var poss2 = $('#poss2').val();
			console.info(userName);
			console.info(poss1);
			console.info(poss2);
			if(poss1==0||userName==0){
				alert("请输入完整内容");
			}else{
				if(poss1==poss2){
					var user = {
							userName : userName,
							poss : poss1,
					}
					console.info(user);
					$.ajax({
						url : '/user/register',
						dataType : 'json',
						data : user,
						type : 'get',
						beforeSend : function() {
							console.info("正在提交");
						},
					})
				}else{
					alert("您输入的两次密码不一样");
				}
			}
			
			
			
			
		}
	</script>
</body>
</html>